﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Domain.DAL;
using System.Web;


namespace Domain.BLL
{
    public class ShoppingCartBLL
    {
        public int ID { get; set; }
        public string CartID { get; set; }
        public int? ProductID { get; set; }
        public int? Count { get; set; }
        public System.DateTime? DateCreated { get; set; }
        public virtual ProductBLL Product { get; set; }
        public List<ShoppingCartBLL> CartItemsColection { get; set; }

        string ShoppingCartId { get; set; }
        public const string CartSessionKey = "CartId";

        public void getCartItem()
        {
            ShoppingCartDAL.getCartItem(this);
        }

        public void addNewItemToCart()
        {
            ShoppingCartDAL.addNewItemToCart(this);
        }

        public int? removeItemFromCart()
        {
            return ShoppingCartDAL.removeItemFromCart(this);

        }

        public void emptyCart()
        {
            ShoppingCartDAL.emptyCart(this);

        }

        public void getCartItems()
        {
            this.CartItemsColection = ShoppingCartDAL.getCartItems(this);
        }

        public int? getCount()
        {
            return ShoppingCartDAL.getCount(this);
        }

        
    }
}
